HDFS-17254. DataNode httpServer has too many worker threads#6307
HDFS-17254. DataNode httpServer has too many worker threads#63072005hithlj wants to merge 1 commit intoapache:trunkfrom
Conversation
|
💔 -1 overall
This message was automatically generated. |
|
LGTM. |
| "dfs.datanode.http.internal-proxy.port"; | ||
| public static final String DFS_DATANODE_NETTY_WORKER_NUM_THREADS_KEY = | ||
| "dfs.datanode.netty.worker.threads"; | ||
| public static final int DFS_DATANODE_NETTY_WORKER_NUM_THREADS_DEFAULT = 0; |
There was a problem hiding this comment.
Thanks for your contribution, but is it reasonable to default to 0 for the number of threads?
There was a problem hiding this comment.
@slfan1989 Thank you for your review, the default value should not continue to be 0, and I plan to change the default value to 10. What do you think, sir?
There was a problem hiding this comment.
@slfan1989 I have changed the default value to 10, and it works normally in our HDFS cluster.
|
@2005hithlj Thanks. Is it caused by enable webhdfs or http UI or some other reasons? |
|
@Hexiaoqiao sir. Thank you for your review, it caused by enable http UI. |
1888454 to
d911ba9
Compare
|
💔 -1 overall
This message was automatically generated. |
|
@2005hithlj Thanks for your contribution. Please also update hdfs-default.xml for the additional config item. |
|
💔 -1 overall
This message was automatically generated. |
|
@Hexiaoqiao OK Sir, I have already fixed and committed it. |
| import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_HTTP_ADDRESS_KEY; | ||
| import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_HTTP_INTERNAL_PROXY_PORT; | ||
| import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_NETTY_WORKER_NUM_THREADS_KEY; | ||
| import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_NETTY_WORKER_NUM_THREADS_DEFAULT; |
There was a problem hiding this comment.
Please add this configuration into hdfs-default.xml. Thanks.
| this.workerGroup = new NioEventLoopGroup(); | ||
| int workerThreads = conf.getInt(DFS_DATANODE_NETTY_WORKER_NUM_THREADS_KEY, | ||
| DFS_DATANODE_NETTY_WORKER_NUM_THREADS_DEFAULT); | ||
| this.workerGroup = new NioEventLoopGroup(workerThreads); |
There was a problem hiding this comment.
Better to use a cached thread pool here. this.workerGroup = new NioEventLoopGroup(workerCount, Executors.newCachedThreadPool()).
|
|
||
| <property> | ||
| <name>dfs.datanode.netty.worker.threads</name> | ||
| <value>10</value> |
There was a problem hiding this comment.
Shouldn't the default be 0, to preserve the original behaviour, earlier we were passing 0 internally here?
this.workerGroup = new NioEventLoopGroup();
There was a problem hiding this comment.
0 is probably not a good default value to use here. I think that is exactly why the author wanted to make it configurable. I don't think there is a strong need to preserve an not-ideal old behavior here.
There was a problem hiding this comment.
Changing defaults is an incompatible change, it should stay the same. the code is there since 2014, if someone finds it isn't a good number he can configure explicitly
There was a problem hiding this comment.
I don't have a strong opinion here. Either way works for me.
| int workerThreads = conf.getInt(DFS_DATANODE_NETTY_WORKER_NUM_THREADS_KEY, | ||
| DFS_DATANODE_NETTY_WORKER_NUM_THREADS_DEFAULT); |
There was a problem hiding this comment.
Should validate this value, for -ve values, if it is -ve we should put a warn log & use default.
|
💔 -1 overall
This message was automatically generated. |
| "dfs.datanode.http.internal-proxy.port"; | ||
| public static final String DFS_DATANODE_NETTY_WORKER_NUM_THREADS_KEY = | ||
| "dfs.datanode.netty.worker.threads"; | ||
| public static final int DFS_DATANODE_NETTY_WORKER_NUM_THREADS_DEFAULT = 10; |
There was a problem hiding this comment.
this needs to be changed as well
There was a problem hiding this comment.
@ayushtkn Thank you for your review, I have changed it.
|
💔 -1 overall
This message was automatically generated. |
|
@slfan1989 @xinglin @Hexiaoqiao Are there any other suggestions for this PR? |
|
lots of unit test failures. Maybe could you create an empty commit and push it to trigger a new build?
|
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
28e38df to
da066dc
Compare
e4739a5 to
dd79100
Compare
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
Hi @2005hithlj , Please check the failed unit tests if related to this PR first. |
| LOG.warn("The value of " + | ||
| DFS_DATANODE_NETTY_WORKER_NUM_THREADS_KEY + " is less than 0, will use default value: " + | ||
| DFS_DATANODE_NETTY_WORKER_NUM_THREADS_DEFAULT); | ||
| workerCount = DFS_DATANODE_NETTY_WORKER_NUM_THREADS_DEFAULT; |
There was a problem hiding this comment.
Use logger format {} instead of concat
There was a problem hiding this comment.
@ayushtkn Thanks for your review. I have revised it. could you take a look? Thanks.
|
💔 -1 overall
This message was automatically generated. |
|
We're closing this stale PR because it has been open for 100 days with no activity. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. |
JIRA: HDFS-17254. DataNode httpServer has too many worker threads